﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Collections;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.Reporting.WebForms;
using System.Data;
using System.Data.SqlClient;

namespace Dragon
{
    public partial class wfDeviceTrackingDetail : System.Web.UI.Page
    {
        DataService ds = new DataService();
        public string Fullname, LocalTime, NetworkTime;
        public double Lat, Lng;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Fullname = Request.QueryString["Fullname"];
                LocalTime = Request.QueryString["LocalTime"];
                NetworkTime = Request.QueryString["NetworkTime"];
                Lat = Convert.ToDouble(Request.QueryString["Lat"]);
                Lng = Convert.ToDouble(Request.QueryString["Lng"]);             
                
                DataTable dt = new DataTable();
                DataColumn col1 = new DataColumn("Title", typeof(System.String));
                DataColumn col2 = new DataColumn("Latitude", typeof(System.Double));
                DataColumn col3 = new DataColumn("Longitude", typeof(System.Double));
                dt.Columns.Add(col1);
                dt.Columns.Add(col2);
                dt.Columns.Add(col3);

                DataRow dr = dt.NewRow();
                dr["Title"] = "Người dùng : <b>" + Fullname + "</b><br>";
                dr["Title"] += "Giờ trên máy : <b>" + LocalTime + "</b><br>";
                dr["Title"] += "Giờ quốc tế : <b>" + NetworkTime + "</b>";
                dr["Latitude"] = Lat;
                dr["Longitude"] = Lng;
                dt.Rows.Add(dr);

                rptMarkers.DataSource = dt;
                rptMarkers.DataBind();
                ClientScript.RegisterStartupScript(this.GetType(), "alert", "InitMap();", true);
            }
        }          
    }
}